<?php
//111111

mt_rand(0, 10);    // 此处调用了 mt_rand 已经在父进程内自动播种
$worker_num = 16;

// fork 进程
for ($i = 0; $i < $worker_num; $i++)
{
    $process = new swoole_process('child_async', false, 2);
    $pid = $process->start();
}

function child_async(swoole_process $worker)
{
    mt_srand();  // 此处 必须要重新播种 否则会得到相同的结果
    echo mt_rand(0, 100) . PHP_EOL;
    $worker->exit();
}

//123
//123